package com.delivery.deliverysystem.service;

import com.delivery.deliverysystem.common.ServerResponse;
import com.delivery.deliverysystem.exception.RException;
import com.delivery.deliverysystem.pojo.DAO.UserDTO;
import com.delivery.deliverysystem.pojo.DO.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.delivery.deliverysystem.pojo.VO.UserVO;

import java.util.List;

/**
* @author Administrator
* @description 针对表【user(用户管理表)】的数据库操作Service
* @createDate 2025-01-13 15:37:40
*/
public interface UserService extends IService<User> {

    /**
     * 创建用户
     * @param userDTO
     * @return
     */
    ServerResponse createUser(UserDTO userDTO);

    /**
     * 更新用户
     * @param userDTO
     * @return
     */
    boolean updateUser(UserDTO userDTO) throws Exception;

    /**
     * 根据id获取用户
     * @param id
     * @return
     */
    UserVO getUserById(Integer id);

    /**
     * 获取用户列表
     * @return
     */
    List<UserVO> getUserList();

    ServerResponse login(String username, String password)throws Exception;

    ServerResponse logout(String username) throws RException;

    User findByUserCode(String username);
}
